//package com.per.mybootall.rabbitmq.finllyAgreement.job;
//
//import com.per.mybootall.dao.UserMapper;
//import com.per.mybootall.pojo.User;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.scheduling.annotation.EnableScheduling;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * job查询db中需要发送的数据=>并send到消息队列中
// * */
//@Component
//@EnableScheduling
//public class SelectDBNeedSendMsg {
//@Resource
//private UserMapper userMapper;
//    @Resource
//    private RabbitTemplate rabbitTemplate;
//    //                "0 0/15 * * * ?"        15分钟一执行                                                                         "0/50 * * * * ?"         50秒一执行
//    @Scheduled(cron = "0 0/50 * * * ?")
//    public void selectNeedSendMsg(){
//       //User user= userMapper.selectAllForUsername("查询状态为待发送的数据");
//        List<User> list=new ArrayList<>();
//       // list.add(user);
//       rabbitTemplate.convertAndSend("newExchange","newRoutingKey",list);
//       System.out.println("由定时任务查询待发送的数据  发送完成==》》");
//    }
//}
